// 导入vue
import Vue from 'vue'
// 导入vue-router
import VueRouter from 'vue-router'
// 首页
import Home from '../views/Home.vue'
// 注册页面
import Login from '../views/Login.vue'
// 登录页面
import Register from '../views/Register.vue'

//简易版群付款页面导入
import PayMoney from '../views/PayMoney.vue'
//计算属性的使用
import Compute from '../views/Compute.vue'

//购物车案例
import ShowCar from '../views/ShowCar.vue'

//家谱案例
import Father from '../views/Father.vue'


// 在.vue文件中要使用router-link或者router-view.需要注册下插件
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  // 配置路径和渲染的组件
  {
    path: '/login',
    component: Login
  },
  // 配置路径和渲染的组件
  {
    path: '/register',
    component: Register
  },
  // 配置简易版群付款页面路径及组件显示
  {
    path: '/paymoney',
    component: PayMoney
  },
  // 计算属性的使用
  {
    path: '/compute',
    component: Compute
  },
  //购物车案例配置路由
  {
    path: '/showcar',
    component: ShowCar
  },
  //家谱案例
  {
    path: '/father',
    component: Father
  }
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: function () {
  //     return import(/* webpackChunkName: "about" */ '../views/About.vue')
  //   }
  // }
]

const router = new VueRouter({
  routes
})

export default router
